﻿using ConsoleApp1;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Metadata;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    public class DoSomethingService
    {
        private readonly IEventBus _eventBus;
        public DoSomethingService(IEventBus eventBus)
        {
            _eventBus = eventBus;
        }

        public async Task DoSomething(int orderId, string customerName)
        {
            var orderCreatedEvent = new DoSomethingEvent(orderId, customerName);
            await _eventBus.Publish(orderCreatedEvent);
        }
    }
}
